import logging,yagmail

def wph():
    logging.basicConfig(filemode='log.txt',filename='w+',level=logging.DEBUG,
                        format='%(asctime)s -> %(levelname)s -> %(message)s')

def fasong(filepath):
    mail = yagmail.SMTP(user='3149797858@qq.com',password='figvaqnsmvdjdfha',host='smtp.qq.com')
    mail.send(to='3149797858@qq.com',subject='测试报告',contents='今日报告请查收',attachments=filepath)

import pymysql

class DB():
    def __init__(self):
        self.con = pymysql.connect(host='10.59.9.14', user='root', password='yidong666', database='a3mall')
        self.cur = self.con.cursor()

    def selectorderinfo(self, orderno):
        #查看表结构 limit指定查询几条
        self.cur.execute('select * from mall_order order_no="%s"' % orderno)
        print(self.cur.fetchall())

    def close(self):
        self.cur.close()
        self.con.close()
 

# d = DB()
# d.selectorderinfo("")
# d.close()
import time
import threading
from time import sleep
print("开始时间： ",time.asctime())
def haoshi():
    for i in range(10):
        print("我是耗时函数1",i+1)
        sleep(1)

def haoshi1():
    for i in range(10):
        print("我是耗时函数2",i+1)
        sleep(1)

t = threading.Thread(target=haoshi)
t2 = threading.Thread(target=haoshi1)
t.start()
t2.start()
#join 当分配给线程的内容，没有 执行完的情况下，助进程不会向下执行
t.join()
t2.join()

print("结束时间: ",time.asctime())
